package com.hutu.kboshi.service.impl;


import com.hutu.kboshi.dao.LikesDao;
import com.hutu.kboshi.pojo.entity.Likes;
import com.hutu.kboshi.service.LikesService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author huzhen
* @description 针对表【likes】的数据库操作Service实现
* @createDate 2024-12-03 18:05:55
*/
@Service
@RequiredArgsConstructor
public class LikesServiceImpl implements LikesService {

    private final LikesDao likesDao;
    @Override
    public boolean isLikes(Long userId, Long problemId) {
        Likes likes = likesDao.isLikes(userId, problemId);
        return likes != null ? true : false;
    }

    @Override
    public List<Long> getProductIdsByUserId(Long userId) {
        return likesDao.getProductIdsByUserId(userId);
    }
}




